From 754df6c6f48f031830ab59fc5d66ced3a9a4c9d7 Mon Sep 17 00:00:00 2001 From: "mjw@wray-m-3.hpl.hp.com" Date: Mon, 9 Aug 2004 12:25:34 +0000 Subject: [PATCH] bitkeeper revision 1.1159.6.2 (41176d3eHxHC1VGHGu53bIhNRwFGGg) Keep domain list up-to-date on domain shutdown. --- tools/python/xen/xend/XendDomain.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/python/xen/xend/XendDomain.py b/tools/python/xen/xend/XendDomain.py index fbb6275b7a..2b8c9671f4 100644 --- a/tools/python/xen/xend/XendDomain.py +++ b/tools/python/xen/xend/XendDomain.py @@ -232,17 +232,23 @@ class XendDomain: not(d['running'] or d['paused'] or d['blocked'])) if dead: casualties.append(d) + destroyed = 0 for d in casualties: id = str(d['dom']) log.debug('XendDomain>reap> domain died id=%s', id) if d['shutdown']: reason = XendDomainInfo.shutdown_reason(d['shutdown_reason']) log.debug('XendDomain>reap> shutdown id=%s reason=%s', id, reason) + if reason in ['suspend']: + continue if reason in ['poweroff', 'reboot']: self.domain_restart_schedule(id, reason) + destroyed += 1 self.final_domain_destroy(id) if self.domain_restarts_exist(): self.domain_restarts_schedule() + if destroyed: + self.refresh_schedule(delay=1) def refresh(self): """Refresh domain list from Xen. @@ -268,7 +274,7 @@ class XendDomain: d.update(info) else: self._delete_domain(d.id) - self.reap_schedule(1) + self.reap_schedule(delay=1) def update_domain(self, id): """Update the saved info for a domain. -- 2.30.2